package com.nettcp;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class TCPFileUploadClient {

public static void main(String[] args) throws IOException, IOException {
		
		
		Socket socket = new Socket("192.168.31.194",1314);
		OutputStream out = socket.getOutputStream();
		
		InputStream in = new FileInputStream("zw.jpg");
		
		byte[] buffer = new byte[200];
		int len=0;
		while((len=in.read(buffer))!=-1){
			out.write(buffer, 0, len);
		}
		in.close();
		out.close();
		
	}

}
